Skip to content

ci: add markdown internal-link checker - #62

Merged
dmchaledev merged 1 commit into
mainfrom
claude/hopeful-knuth-f8pohp
Aug 7, 2026
Merged

ci: add markdown internal-link checker#62
dmchaledev merged 1 commit into
mainfrom
claude/hopeful-knuth-f8pohp

Conversation

@dmchaledev

Copy link
Copy Markdown
Contributor

Summary

  • This repo is documentation-only and heavily cross-linked — README.md links into mappings/, docs/, templates/, and industry-variants/, and several open issues (e.g. Framework mapping docs are missing the MFA and Ransomware Response policies #59) propose adding even more cross-references between mapping files. Nothing currently verifies that a relative markdown link or image path still resolves after a file is renamed or moved.
  • Adds scripts/check_links.sh: walks every *.md file, extracts relative link/image targets, and fails if any resolved path doesn't exist on disk. External links (http/https/mailto) and pure anchors (#section) are intentionally skipped so the check can't flake on network issues or rate limits.
  • Wires it into .github/workflows/ci.yml as a new markdown-links job, and adds the new script to the existing shellcheck job's lint coverage.
  • Verified locally: the script passes cleanly against the current repo (zero broken links today), and correctly fails with a BROKEN: <file> -> <link> line when a bogus relative link is injected.

Test plan

  • shellcheck scripts/customize.sh scripts/check_links.sh — no warnings
  • bash scripts/check_links.sh on current main — reports "All internal markdown links resolve correctly."
  • Injected a deliberately broken relative link into a scratch file and confirmed the script detects it and exits non-zero
  • Validated .github/workflows/ci.yml YAML syntax

Generated by Claude Code

This repo is documentation-heavy with dense cross-linking between
README.md, docs/, and mappings/ (and more mapping-file cross-references
proposed in open issues like #59). Nothing currently catches a relative
link or image path broken by a future rename/move — add
scripts/check_links.sh, which resolves every relative markdown link
against the filesystem and fails on any that don't exist, wired into CI
as a new markdown-links job. External (http/mailto) links and anchors
are intentionally skipped to avoid network flakiness in CI.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VKs7fC7VMaGgqu965dum4h
@dmchaledev
dmchaledev merged commit 7b3c3c2 into main Aug 7, 2026
3 checks passed
@dmchaledev
dmchaledev deleted the claude/hopeful-knuth-f8pohp branch August 7, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants